'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_pb_123';
  config.view = {
    defaultViewEngine: 'nunjucks',
    mapping: {
      '.html': 'nunjucks',
    },
  };
  config.session = {
    key: 'AOS_SESS',
    maxAge: 1800 * 1000, // 1小时
    httpOnly: true,
    encrypt: true,
  };
  config.news = {
    // pageSize: 5,
    port1: '7010',
    port2: '7010/ppdksh',
    serverUrl: '84.12.68.101', // 接口公共部分，通过this.config.news访问
  };
  // config.cors = {

  //     }
  config.security = {
    csrf: {
      enable: false,
    },

  };
  // 编写
  // add your config here
  config.middleware = ['filter']; // 挂载中间件

  return config;
};
